{% extends "master.html" %}

{% block script %}
Go2.Init("{{username}}", "{{csrf}}");

var txtUsername;

function Loaded()
{
	txtUsername = document.getElementById('username');
	if (txtUsername)
		{
		txtUsername.focus();
		Go2.AddEventFn(txtUsername, "keydown", KeyDown);
		}
}

function KeyDown(evt)
{
	if (evt.keyCode == 13)
		Go2.SetUsername(txtUsername.value);
}
{% endblock %}

{% block body %}
<div class="page">

{% block header %}
<div class="head">
	<div class="signin">
	{% if username %}
		Welcome <a href="/user/{{username}}" title="{{username}}'s activity">{{username}}</a>
		{% if profile %}
			(<a href="/profile/" title="{{username}}'s profile">Profile</a>)
		{% else %}
			(<a href="/profile/" title="Your nickname is temporary until you create a (free) account.">Create Account</a>)
		{% endif %} |
		<a href="#" onclick="Go2.SetUsername('');return false;">Sign out</a>
	{% else %}
		<div id="sign-in">
		    <label for="username">Nickname: </label>
		    <input maxlength="20" style="width:70px;" type="text" id="username" name="username"/>
			<input onclick="Go2.SetUsername(txtUsername.value);" style="width:70px;" type="button" value="Set It"/>
		</div>
	{% endif %}
	</div>

	<a target="_top" href="/"><img title="{{site_name}}" class="logo" src="/images/logo.png"></a>

	<div class="page-heading">
		{% block page-heading-extra %}{% endblock %}
		<h1>{% block page-heading %}{{site_title}}{% endblock %}</h1>
		<p class="subhead">{% block page-subheading %}{{site_tagline}}{% endblock %}</p>
	</div>
</div>
{% endblock %}

{% block pagebody %}
{% endblock %}

<div class="timer"><span>Elapsed time: {{elapsed}}s</span></div>

</div> <!-- page -->
{% endblock %}

{% block footer %}
<div class="bottom">
<a href="http://code.google.com/p/g02me/wiki/AboutUs">About Us</a> |
<a href="http://blog.go2.me">Blog</a> |
<a href="http://code.google.com/p/g02me/wiki/API">Developers</a> |
<a href="http://getsatisfaction.com/g02me/products/g02me_g02me">Feedback</a> |
<a href="http://code.google.com/p/g02me/wiki/TermsOfService">Terms of Service</a> |
<a href="http://twitter.com/go2me">Follow {{site_name}} on Twitter</a>
</div>

<div style="text-align:center;padding-top:20px;">
<a href="http://code.google.com/p/g02me/">
	<img src="http://code.google.com/appengine/images/appengine-silver-120x30.gif" alt="Powered by Google App Engine" />
</a>
</div>
{% endblock %}

